package com.ztmmm.module.exam.controller;

import com.ztmmm.common.vo.ApiRest;
import com.ztmmm.module.exam.dto.ExamSaveDto;
import com.ztmmm.module.exam.entity.Exam;
import com.ztmmm.module.exam.service.IExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 课程 前端控制器
 * </p>
 *
 * @author ztm
 * @since 2023-03-23
 */
@RestController
@CrossOrigin
@RequestMapping("/exam")
public class ExamController {
@Autowired
private IExamService iExamService;
    @PostMapping("save")
    public ApiRest save(@RequestBody ExamSaveDto examSaveDto){
        return iExamService.create(examSaveDto);
    }



    @GetMapping("myExam")
    public ApiRest<List<Exam>> list(){
        return iExamService.myExams();
    }
}
